package ${packageName};

import com.baomidou.mybatisplus.annotation.TableName;
import com.zeng.nicecore.bean.CommonBean;
import lombok.*;
import lombok.experimental.FieldNameConstants;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

<#list table.rows as row>
    <#assign
    typeName = row.type?split(" ")
    typeNamePo = (typeName?size) - 1
    typeFullName = typeName[typeNamePo]
    />
    <#if !typeFullName?contains("lang")>
import ${typeFullName};
    </#if>
</#list>

/**
*
* @description ${table.desc}
* @author ${table.author}
* @version ${table.createDate}
*/
@Data
@Entity
@Table(name = "${prefix}_${table.realTableName}")
@TableName(value = "${prefix}_${table.realTableName}")
@EqualsAndHashCode(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldNameConstants
public class ${table.className} extends CommonBean {

<#list table.rows as row>
    <#assign
    typeName = row.type?split(".")
    typeNamePo = (typeName?size) - 1
    typeFullName = typeName[typeNamePo]
    />
    //${row.desc}
    <#if row.length??>
    @Column(length = ${row.length})
    </#if>
    private ${typeFullName} ${row.name};

</#list>
}
